package com.tre.code.auto.generator;

import com.baomidou.mybatisplus.annotation.DbType;
import generate.generatecode.GeneratorAutoCode;
import org.jasypt.exceptions.EncryptionOperationNotPossibleException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @program: jdev-boot-core
 * @description
 * @author: JDev
 * @create: 2021-08-05 14:12
 **/
public class MySqlCodeGenerator {
    private static final Logger logger = LoggerFactory.getLogger(MySqlCodeGenerator.class);

    private MySqlCodeGenerator() {

    }

    /**
     * MySQL jdbc:mysql://localhost:3306/powernode
     *
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
        try {
            GeneratorAutoCode.generator(
                    "C:\\Users\\xym23\\Desktop\\mysqlCode"
                    , DbType.MYSQL
                    , "com.mysql.cj.jdbc.Driver",
                    "jdbc:mysql://localhost:3306/platform?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC"
                    , "root"
                    , "AXkGph3yLeXyz3RlCG02Z4wPRzZb1yVG");
        } catch (EncryptionOperationNotPossibleException ex) {
            logger.error(ex.getMessage());
        }
    }
}
